//
//  DHAddressTableViewCell.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/1/16.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "DHAddressTableViewCell.h"

@interface DHAddressTableViewCell()

@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UILabel *address_detailLabel;
@property (weak, nonatomic) IBOutlet UILabel *distanceLabel;

@end

@implementation DHAddressTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)updateCell:(AMapPOI *)poi andCurrentLocation:(CLLocation *)currentLocation{
    self.addressLabel.text = poi.name;
    self.address_detailLabel.text = [NSString stringWithFormat:@"%@%@%@%@",poi.province,poi.city,poi.district,poi.address];
    if (currentLocation) {
        self.distanceLabel.text = [Location calculatePointDistanceWithBeginLatitude:currentLocation.coordinate.latitude beginLongitude:currentLocation.coordinate.longitude endLatitude:poi.location.latitude endLongitude:poi.location.longitude];
    }else{
        self.distanceLabel.text = @"0KM";
    }
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
